#include<iostream>
using namespace std;
const int N = 110;
int arr[N];
int n;
int a, b;
int main()
{
	cin >> n;
	for (int i = 0; i < n - 1; i++) {
		cin >> arr[i];
	}
	cin >> a >> b;
	int sum = 0;
	for (int i = a; i <= b - 1; i++) {
		sum += arr[i];
	}
	cout << sum << endl;
	return 0;
}